ZONE2021 B
種別: 記事
カテゴリ: 競技プログラミング
サブカテゴリ: AtCoder > ZONeエナジー プログラミングコンテスト “HELLO SPACE”
タグ: #解いた問題
(工事中)
2021年5月1日にAtCoder で開催されたコンテストであるZONeエナジー プログラミングコンテスト “HELLO SPACE” のB問題に関するメモ
解き方
解答例
下は上記の方法で解いたときの提出結果である。また、その提出の際に提出したソースコードをその下に転記する。
code: C
#include <stdio.h>
int main () {
int n = 0;
int d_ufo = 0;
int h_ufo = 0;
int res = 0;
double max_h = 0.0;
res = scanf("%d", &n);
res = scanf("%d", &d_ufo);
res = scanf("%d", &h_ufo);
for (int i = 0; i < n; i++) {
int d = 0;
int h = 0;
double x = (double) h_ufo;
res = scanf("%d", &d);
res = scanf("%d", &h);
x += ((double) ((h - h_ufo) * d_ufo)) / ((double) (d_ufo - d));
if (x > max_h) {
max_h = x;
}
}
printf("%.16lf\n", max_h);
return 0;
}
私の提出一覧
table: submissions_abc-like_contest_zone2021_B
提出のURL 提出時刻 結果 備考
1回目 https://atcoder.jp/contests/zone2021/submissions/22210929 2021-05-01T21:30:52+0900 AC
感想